<html>
<head>
<title>Preview of Image</title>
<style type="text/style">
#preview
{
	width:100%; text-align:center;
}

#preview div
{
	padding:5px; font-size:12px; text-align:center; width:90%;
}
img
{
	border:none;
	text-align:center;
	margin:0 auto;
}

</style>
<script type="text/javascript">
window.onload = function(){
	if(window.location.search)
	{
		q = decodeURIComponent(window.location.search);		
		ar = q.substr(1,q.length);
		ar1 = ar.split("&");
		
		if(ar1.length==2)
		{	
			av1 = ar1[0].split("=");
			av2 = ar1[1].split("=");
			
			if(av1[0]=='i' && av2[0]=='t')
			{	
				if(av1[1]!='')				
				{	
					var imagen = av1[1];
					imagen = imagen.substr(1,imagen.length-5) + "_6.jpg";
					var title = av2[1];
					
					console.log(imagen);
					var img = document.createElement("img");					
					img.setAttribute("src",av1[1]);
					
					var div = document.createElement("div");
					div.innerHTML=title;
					
					document.getElementById("preview").appendChild(img);
					document.getElementById("preview").appendChild(div);
				}
				
				
			}
			
		}
		
		
	}
}


</script>
</head>
<body>
<div id="preview"></div>
</body>
</html>